package rounding;

import junit.framework.Assert;
import junit.framework.TestCase;

public class RoundingTest extends TestCase {

	public void test1(){
		Rounding r = new Rounding(5.122, 5.123);
		String s1 = r.compareRounds();
		String s2 = r.difference();
		Assert.assertEquals("Equals when rounding", s1);
		Assert.assertEquals("Differ by less than 0.01", s2);
	}
	
	public void test2(){
		Rounding r = new Rounding(5.132, 5.121);
		String s1 = r.compareRounds();
		String s2 = r.difference();
		Assert.assertEquals("Different when rounding", s1);
		Assert.assertEquals("Differ by more than 0.01", s2);
	}
}
